<template>
  <div class="top">
    <div class="top_1">
      <p>收货方式</p>
      <p class="wuliu">物流配送</p>
    </div>
    <!-- 收货地址 -->
    <div class="Receiving" v-for="(a, index) in site" :key="index">
      <a class="Receiving_">
        <div>
          <p class="minzi">
            {{ a.name }} <span>{{ a.tel }}</span>
          </p>
          <p>{{ a.address }}</p>
        </div>
        <p class="jiantou" @click="sh">点击添加新地址+</p>
      </a>
      <b class="border"></b>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      site: [],
    };
  },
  created() {
    let id = this.$route.query.id ? this.$route.query.id :1
    axios.get("/site1?id="+id).then((res) => {
      this.site=res.data
      console.log(res);
      // for (let v in this.$route.query) {
      //   res.data.forEach((good) => {
      //     if (good.id == this.$route.query[v]) {
      //       this.site.push(good);
      //     }
      //   });
      // }
    });
  },
  methods: {
    sh() {
      this.$router.push("/dzxiugai");
    },
  },
};
</script>

<style scoped>
.top {
  width: 100%;
  height: 1.21rem;
  box-sizing: border-box;
  padding: 0.06rem 0.1rem 0.14rem;
  margin-bottom: 0.15rem;
}
.top_1 {
  width: 100%;
  height: 0.46rem;
  margin-bottom: 0.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}
.wuliu {
  width: 0.78rem;
  height: 0.28rem;
  line-height: 0.28rem;
  color: #fff;
  background: #f60;
  border: 0.01rem solid #ddd;
  border-color: #f60;
  border-radius: 0.2rem;
  text-align: center;
  font-size: 0.14rem;
}
.Receiving_ {
  width: 100%;
  height: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.Receiving_ p {
  font-size: 0.14rem;
}
.minzi {
  padding-bottom: 0.04rem;
}
.Receiving {
  position: relative;
}
.border {
  position: absolute;
  bottom: -0.15rem;
  left: 0;
  height: 3px;
  width: 100%;
  background: url(//img1.yiwugou.com/mobile/wechat-shop/location-border.png)
    repeat-x;
  background-size: 90px 2px;
}
.jiantou {
  color: red;
}
</style>